var mongodb = require('./mongodb');


var Schema = mongodb.mongoose.Schema;
var ObjectId = Schema.ObjectId;

var ClasseSchema = new Schema({
    name: {type: 'String', required: true},
    uid: {type: ObjectId, required: true},
    viewNumber: {type: 'Number', default: 0},//总共查看次数,默认为0
    wordsNumber: {type: 'Number', default: 0},//类别下的单词数量,默认为0
    completeNumber: {type: 'Number', default: 0},//游戏完成次数,默认为0
    createTime: { type: Date, default: Date.now},
    modifyTime: {type: Date, default: Date.now},
    status: {type: 'Number', default: 0, required: true, min: 0, max: 1}
}, {
    collection: "classes"
});



module.exports = mongodb.mongoose.model("Classe", ClasseSchema);
